<?php echo '<?xml version="1.0" ?>'; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>UGamela</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<link rel="shortcut icon" href="phfavicon.ico" />
<link rel="stylesheet" type="text/css" href="../skins/darkness_v01/formate.css" />

<script type="text/javascript" src="js/jquery-1.3.2.js"></script>
<!--<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>-->
<script type="text/javascript" src="js/jquery.jbind-1.5.8.js"></script>
<script type="text/javascript" src="js/PhlameEngine.js"></script>
<script type="text/javascript">
Template.set('widget', '<div class="widget">\n<!--div-->\n    <div id="{id}">\n        {html}\n    </div>\n<!--div-->\n</div>');
$(function(){
    $.getJSON('AjaxController.php', function(ret) {
        //console.log(ret);
        $tpl(ret.tpl).bindTo(ret.data, '#menu', 'main');
    });
//console.profile();
    /*$.getJSON('get.php?file=test', function(data){
        $tpl('widget').extend('test')
                      .bindTo(data, {'root':'div', 'appendTo':'#content'});
        /*
	    $tpl.extend('widget', 'test', function(){
            //alert(data);
            $tpl.bindTo('test', data, {'root':'div', 'appendTo':'#content'});
        });
        /*
            //Template.set('widget', $('#tpls .widget').html());
            var d = [
                {
                    id:1,
                    html:'bla'
                },
                {
                    id:2,
                    html:'blum'
                }
            ];
            $tpl.extend('divtest', $tpl.get('test'), 'widget');
            //alert($(Template.get('divtest')));
            $($tpl.get('divtest')).bindTo(data, {'root':'div', 'appendTo':'body'});
        });
    });*/
});
</script>
</head>
<body>
<div id="menu">
</div>
<div id="content">
</div>
</body>
</html>

